

class vehicle :
    imei = None
    prod = None
    __voltage = None
    def __init__(self,make,model,year):
        self.make = make
        self.model = model
        self.year = year
    def start(self):
        print(f"{self.make}{self.model} started")
    def stop(self):
        print(f"{self.make}{self.model} stopped")
    def __val(self):
        print("这是个私有的方法")



class car(vehicle) :
    def __init__(self,make,model,year,num):
        super.__init__(make,model,year)
        self.num = num
    def start(self):
        print(f"启动了{self.num}辆车")



class phone:
    imei = None
    producer = None
    __current_voltage = None #当前电压

    def call_by_5g(self,__current_voltage):
        self.__current_voltage = __current_voltage
        if self.__current_voltage >= 1:
            self.__keep_single_core()
            print("5g通话已经开启")
        else:
            print("通话失败，电量不足")

    def __keep_single_core(self):
        print("cpu单核运行")

#定义一个动物父类
class Animal:
    def __init__(self,name):
        self.name = name
    def speak(self):
        print(f"{self.name}发出了声音")

class Dog(Animal):
    breed = None
    def __int__(self,name,breed):
        super().__init__(name)
        self.breed = breed

    def speak(self):
        super().speak()


    def fetch(self):
        print(f"{self.name}正在追逐球")

animal = Animal("动物")



dog = Dog(name="小狗")
dog.speak()
dog.fetch()